﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace CNShapeViewer
{
    /// <summary>
    /// Interface for classes that can render shapes from the CNShapes library onto the
    /// ShapeViewerControl.
    /// </summary><remarks>
    /// You should create one class implementing this interface for each shape that needs
    /// to be rendered. These should then be registed with the ShapeViewerControl in its
    /// contructor.
    /// 
    /// getShapeType
    /// ------------
    /// The interface includes the getShapeType() method which should return the Type of the 
    /// shape being rendered. This is how the ShapeViewerControl can tell which renderer to 
    /// choose for a given shape. This means that although the ShapeViewerControl does not
    /// anything about the actual type of the shape being rendered, the specific rendering
    /// classes do know about it, so they should be able to safely cast the Shape passed to 
    /// them to the specific type.
    /// </remarks>
    interface IShapeRenderer
    {
        /// <summary>
        /// The implementation should render the shape passed in to the graphics surface passed in.
        /// </summary>
        void renderShape(CNShapes.Shape shape, Graphics graphics, ShapeViewerControl shapeViewerControl);

        /// <summary>
        /// Returns the Type of the specific shape that the implementation renders.
        /// </summary>
        Type getShapeType();
    }
}
